import request from '@/utils/axiosReq'

export function loginReq(data) {
  return request({
    url: '/api/doLogin',
    data,
    method: 'post',
    bfLoading: false,
    isParams: false,
    isAlertErrorMsg: false
  })
}

export function getInfoReq(param) {
  return request({
    url: '/api/getRoles',
    bfLoading: false,
    method: 'get',
    data:param,
    isParams: true,
    isAlertErrorMsg: false
  })
}

export function logoutReq() {
  return request({
    url: '/api/logout',
    method: 'post'
  })
}

export function getUsers(param) {
  return request({
    url: '/api/getUsers',
    data:param,
    method: 'get',
    bfLoading: true,
    isParams: true,
    isAlertErrorMsg: false
  })
}

export function addUsers(param) {
  return request({
    url: '/api/register',
    data:param,
    method: 'post',
    bfLoading: true,
    isParams: false,
    isAlertErrorMsg: false
  })
}

export function updateuser(param) {
  return request({
    url: '/api/updateUser',
    data:param,
    method: 'post',
    bfLoading: true,
    isParams: false,
    isAlertErrorMsg: false
  })
}

export function addopinions(param) {
  return request({
    url: '/api/addOpinion',
    data:param,
    method: 'post',
    bfLoading: true,
    isParams: false,
    isAlertErrorMsg: false
  })
}

deleteUser

export function deleteUser(param) {
  return request({
    url: '/api/deleteUser',
    data:param,
    method: 'get',
    bfLoading: true,
    isParams: true,
    isAlertErrorMsg: false
  })
}
